//
//  NetworkTool.h
//
//
//  Created by admin on 17/3/2.
//  Copyright © 2017年 admin. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <AFNetworking/AFNetworking.h>
#import "LCUPInfoNetworking.h"

NS_ASSUME_NONNULL_BEGIN

#define kNetworkTool ([NetworkTool sharedInstance])

@interface NetworkTool : AFHTTPSessionManager

@property (nonatomic,copy) NSString *upLoadUrl;

@property (nonatomic,strong) AFHTTPSessionManager *manager;

//单例模式类
+ (instancetype)sharedInstance;

- (void)setHeaderForAppid:(NSString *)appid appsecret:(NSString *)appsecret;

/**
 GET获取数据的主方法
 
 @param urlString 请求地址
 @param parameters 请求参数
 @param successBlock 成功回调
 @param failureBlock 失败回调
 */
- (void)GETWithUrlString:(NSString *)urlString parameters:(id)parameters headers:(nullable NSDictionary <NSString *, NSString *> *)headers success:(void(^)(NSDictionary *dict))successBlock failure:(void(^)(NSError *error))failureBlock;


/**
 POST获取数据的主方法
 
 @param urlString 请求地址
 @param parameters 请求参数
 @param successBlock 成功回调
 @param failureBlock 失败回调
 */
- (void)POSTWithUrlString:(NSString *)urlString parameters:(id)parameters headers:(nullable NSDictionary <NSString *, NSString *> *)headers success:(void(^)(NSDictionary *dict))successBlock failure:(void(^)(NSError *error))failureBlock;


@end

NS_ASSUME_NONNULL_END
